package com.hu.ssm.service.impl;

import com.hu.ssm.entity.Emp;
import com.hu.ssm.mapper.EmpMapper;
import com.hu.ssm.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class EmpServiceImpl implements EmpService {

    private EmpMapper empMapper;

    @Autowired
    public EmpServiceImpl(EmpMapper empMapper) {
        this.empMapper = empMapper;
    }

    @Override
    @Transactional
    public void save(Emp emp) {
        this.empMapper.save(emp);
    }

    @Override
    public List<Emp> findAll() {
        return this.empMapper.findAll();
    }

}
